package com.itheima.stock.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import jdk.jfr.Experimental;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class StockInfoExcelDTO {
    /**
     * 序号
     */
    @ExcelProperty(value = "序号",index = 1)
    private String num;
    /**
     * 股票名称
     */
    @ExcelProperty(value = "股票名称",index = 2)
    private String name;
    /**
     *成交量
     */
    @ExcelProperty(value = "成交量",index=3)
    private Long tradeAmt;
    /**
     * 当前收盘价
     */
    @ExcelProperty(value = "当前收盘价",index=4)
    private BigDecimal preClosePrice;
    /**
     * 振幅
     */
    @ExcelProperty(value = "振幅",index=5)
    private BigDecimal amplitude;
    /**
     * 股票代码
     */
    @ExcelProperty(value = "股票代码",index=6)
    private String code;

    /**
     * 当前日期
     */
    @ExcelProperty(value = "当前日期",index=7)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private LocalDate curDate;
    /**
     * 交易额
     */
    @ExcelProperty(value = "交易额",index=8)
    private BigDecimal tradeVol;
    /**
     * 涨幅
     * 计算公式：当前价格-前收盘价/前收盘价
     */
    @ExcelProperty(value = "涨幅",index=9)
    private BigDecimal increase;
    /**
     * 涨跌
     * 计算公式：当前价格-前收盘价
     */
    @ExcelProperty(value = "涨跌",index=10)
    private BigDecimal upDown;
    /**
     * 交易价格
     *
     */
    @ExcelProperty(value = "交易价格",index=11)
    private BigDecimal tradePrice;
}
